<template>
  <div class="footer">
    <a href="javascript:;" @click="goto('/msite')">
      <span :class="{ currentColor: '/msite' === $route.path }">
        <i class="iconfont icon">&#xe606;</i>
      </span>
      <span :class="{ currentColor: '/msite' === $route.path }">外卖</span>
    </a>
    <a href="javascript:;" @click="goto('/search')">
      <span :class="{ currentColor: '/search' === $route.path }">
        <i class="iconfont icon">&#xe613;</i>
      </span>
      <span :class="{ currentColor: '/search' === $route.path }">搜索</span>
    </a>
    <a href="javascript:;" @click="goto('/order')">
      <span :class="{ currentColor: '/order' === $route.path }">
        <i class="iconfont icon">&#xe607;</i>
      </span>
      <span :class="{ currentColor: '/order' === $route.path }">订单</span>
    </a>
    <a href="javascript:;" @click="goto('/profile')">
      <span :class="{ currentColor: '/profile' === $route.path }">
        <i class="iconfont icon">&#xe601;</i>
      </span>
      <span :class="{ currentColor: '/profile' === $route.path }">我的</span>
    </a>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {
    goto(path) {
      this.$router.push(path)
    }
  }
}
</script>

<style lang="less" scoped>
.currentColor {
  color: #02a774 !important;
}
.footer {
  height: 1rem;
  background-color: #fff;
  border-top: 0.02rem solid #ccc;
  position: fixed;
  bottom: 0;
  z-index: 99;
  width: 100%;
  display: flex;
  align-items: center;
  a {
    display: flex;
    display: inline-block;
    width: 25%;
    flex-direction: column;
    padding: 0.06rem;
    span {
      display: flex;
      justify-content: center;
      height: 50%;
      font-size: 0.4rem;
      color: #999;
      padding-top: 0.06rem;
      .icon {
        font-size: 0.5rem;
      }
    }
  }
}
</style>
